package com.tmt.im.service.websocket;

import com.alibaba.fastjson2.JSONObject;
import jakarta.websocket.EncodeException;
import jakarta.websocket.Encoder;
import jakarta.websocket.EndpointConfig;

/**
 * Author yi.wu
 * Date 2023/1/7 14:52
 *
 * @author wuyi
 */
public class ServerTextEncoder implements Encoder.Text<Object> {


    @Override
    public String encode(Object obj) throws EncodeException {
        return JSONObject.toJSONString(obj);
    }

    @Override
    public void init(EndpointConfig endpointConfig) {
    }

    @Override
    public void destroy() {
    }
}
